package com.sxz.sbs.module.telephone.adapter;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sxz.sbs.R;
import com.sxz.sbs.app.GlideApp;
import com.sxz.sbs.module.telephone.bean.TelBookBean;

import java.util.List;

/**
 * Created by hp on 2018/1/6.
 * 部门具体人员列表Adapter
 */

public class TelPersonnelAdapter extends BaseQuickAdapter<TelBookBean.ManagerListBean,BaseViewHolder> {

    public TelPersonnelAdapter(@Nullable List<TelBookBean.ManagerListBean> data) {
        super(R.layout.item_telpersonnel,data);
    }
    @Override
    protected void convert(BaseViewHolder holder, TelBookBean.ManagerListBean item) {
        GlideApp.with(mContext).load(item.getUrl_HeadPhoto()).placeholder(R.drawable.ic_headportrait)
                .error(R.drawable.ic_headportrait).circleCrop().into((ImageView) holder.getView(R.id.iv_circle_name));
        holder.setText(R.id.tv_personnel_name,item.getTxt_Name());
        if (item.getMark() == 1) {
            holder.setVisible(R.id.iv_star_care,true);
        } else {
            holder.setVisible(R.id.iv_star_care,false);
        }
        holder.addOnClickListener(R.id.iv_telbook_call);
    }
}
